package com.messi.mall.order.service.impl;

import java.util.HashMap;
import java.util.Map;

public class Test {
    public static void main(String[] args) throws Exception {
        //int a = 0;
        //String[] a = {"123"};
        Map<String,String> a = new HashMap<>();
        //a.put("1","2");
        System.out.println(check(a));

    }
    private static boolean check(Object o) throws Exception {
        if(o instanceof String[]){
            String[] arr = (String[]) o;
            return (null == arr || 0== arr.length);
        }
        if(o instanceof Map){
            Map<String,String> map = (Map<String, String>) o;
            return (null == map || 0== map.size());
        }
        throw new Exception("无法识别的参数类型");
    }
}
